package cn.anecansaitin.jep.parser.ast.node.expression.literal;

import cn.anecansaitin.jep.Token;
import cn.anecansaitin.jep.TokenType;
import cn.anecansaitin.jep.types.TypeInfo;

public final class CharLiteral extends Literal {
    private final char value;

    public CharLiteral(Token peek) {
        this(peek.value(), peek.line(), peek.column());
    }

    public CharLiteral(String value, int line, int column) {
        super(TokenType.CHAR_LITERAL, TypeInfo.CHAR, line, column);
        this.value = value.charAt(0);
    }

    public char value() {
        return value;
    }
}